\(y_i = \alpha + \beta x_i + \epsilon, \;\;\textrm{with}\;\;\epsilon_i \sim Normal(0, \sigma)\)
This is equivalent to
\(y_i - (\alpha + \beta x_i) \sim Normal(0, \sigma)\)
and finally to the more multilevel-friendly form
\(y_i \sim Normal(\alpha + \beta x_i, \sigma)\)
\(MLU(child_i) \sim Normal(\alpha + \beta \cdot MLU(mother_i), \sigma)\)
## (Intercept) MOT_MLU
## -1.0680205 0.7813712
\[\begin{align} MLU(child) &= -1.07 + 0.78 \cdot MLU(mother)\\ R^2_{adj}&=0.32 \end{align}\]
\[\begin{align} MLU(child) &= -1.07 + 0.78 \cdot MLU(mother)\\ &= -1.07 + .78 \cdot 4.5\\ &= 2.44 \end{align}\]
## (Intercept) MOT_MLU DiagnosisTD MOT_MLU:DiagnosisTD
## -0.4088249 0.5608042 -0.9397872 0.3198611
\[\begin{align} MLU(child_{ASD}) &= -0.41 + 0.56 \cdot MLU(mother)\\ MLU(child_{TD}) &= -.41 + .56 \cdot MLU(mother) -.94 + .32 \cdot MLU(mother)\\ &= -1.35 + .88 \cdot MLU(mother)\\ R^2_{adj}&= .35 \end{align}\]
\[\begin{align} MLU(child_{ASD}) &= -0.41 + 0.56 \cdot MLU(mother)\\ &= -0.41 + 0.56 \cdot .45\\ &= 2.11 \end{align}\]
\[\begin{align} MLU(child_{TD}) &= -1.35 + .88 \cdot MLU(mother)\\ &= -1.35 + .88 \cdot.45\\ &= 2.61 \end{align}\]
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
For each statistical problem, we follow three general steps:
formula1 <- brms::bf(CHI_MLU ~ MOT_MLU * Diagnosis)
model1 <- brms::brm(formula = formula1,
data = data,
file = 'data/w5/example')
model1## Family: gaussian
## Links: mu = identity; sigma = identity
## Formula: CHI_MLU ~ MOT_MLU * Diagnosis
## Data: data (Number of observations: 352)
## Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
## total post-warmup draws = 4000
##
## Population-Level Effects:
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept -0.40 0.31 -1.02 0.20 1.00 1814 2230
## MOT_MLU 0.56 0.08 0.40 0.73 1.00 1784 2338
## DiagnosisTD -0.96 0.53 -2.01 0.08 1.00 1373 1770
## MOT_MLU:DiagnosisTD 0.32 0.13 0.06 0.58 1.00 1352 1812
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma 0.75 0.03 0.70 0.81 1.00 2975 2481
##
## Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
# This function shows which priors a model fitted with brms has (implicitly) assumed
brms::prior_summary(model1)## prior class coef group resp dpar nlpar lb
## (flat) b
## (flat) b DiagnosisTD
## (flat) b MOT_MLU
## (flat) b MOT_MLU:DiagnosisTD
## student_t(3, 1.9, 2.5) Intercept
## student_t(3, 0, 2.5) sigma 0
## ub source
## default
## (vectorized)
## (vectorized)
## (vectorized)
## default
## default